package com.heima.wemedia.listener;

import com.alibaba.fastjson.JSON;
import com.heima.model.wemedia.pojos.WmNews;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class kafkaListener {

    @KafkaListener(topics = "topic1")
    public void consumerMsg(String msg){
        WmNews wmNews = JSON.parseObject(msg, WmNews.class);
        System.out.println("消息是msg{}"+wmNews);
    }
}
